From bcb871f1fd7c776fe09b2f4b40e51a615d231513 Mon Sep 17 00:00:00 2001 From: "kfraser@localhost.localdomain" Date: Sat, 23 Sep 2006 14:04:22 +0100 Subject: [PATCH] [HVM] Fix timer interrupt underflow bug. Without the patch, vlapic->intr_pending_count could become a very small negative, causing some local APIC timer interrupts lost. Signed-off-by: Dexuan Cui Signed-off-by: Edwin Zhai --- xen/arch/x86/hvm/vlapic.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/xen/arch/x86/hvm/vlapic.c b/xen/arch/x86/hvm/vlapic.c index a3ed24a491..533b6c8237 100644 --- a/xen/arch/x86/hvm/vlapic.c +++ b/xen/arch/x86/hvm/vlapic.c @@ -946,9 +946,11 @@ void vlapic_post_injection(struct vcpu *v, int vector, int deliver_mode) if ( vector == vlapic_lvt_vector(vlapic, APIC_LVTT) ) { - vlapic->intr_pending_count[vector]--; if ( vlapic->intr_pending_count[vector] > 0 ) + { + vlapic->intr_pending_count[vector]--; vlapic_test_and_set_vector(vector, vlapic->regs + APIC_IRR); + } } break; -- 2.30.2